package com.koron.css2.serviceManage.mapper;

import com.koron.css2.serviceManage.bean.PubCostBean;
import com.koron.css2.serviceManage.bean.SelectBean;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface PubCostMapper {
	
	/**
	 * 查询列表
	 * 
	 * @return
	 */
	List<PubCostBean> selectPubCostList(@Param("status") String status);
	
	/**
	 * 
	 * @param PubCostBean
	 * @return
	 */
	PubCostBean selectPubCostById(@Param("id") String id);

	/**
	 * 添加
	 * 
	 * @param PubCostBean
	 * @return
	 */
	void insertPubCost(PubCostBean PubCostBean);
	
	/**
	 * 校验字段内容重复
	 */
	@Select("select count(*) from PUB_COST where ${key} = #{val}")
	Integer check(@Param("key") String key, @Param("val") String val);
	
	/**
	 * 校验字段内容重复-排除当前记录
	 */
	@Select("select count(*) from PUB_COST where ${key} = #{val} and id <> #{id}")
	Integer check2(@Param("key") String key, @Param("val") String val, @Param("id") String id);
	
	
	/**
	 * 修改
	 * 
	 * @param PubCostBean
	 * @return
	 */
	Integer updatePubCost(PubCostBean PubCostBean);
	
	/**
	 * 下拉框
	 * 
	 * @return
	 */
	List<SelectBean> selectComboBox();


}
